<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>登录</title>
</head>

<body>

	<div id="app">
		账号：<input placeholder="请输入手机号或电子邮箱" v-model="o.openid">
		<br>
		密码：<input type="password" v-model="o.password">
		<button @click="login">登录</button>

	</div>

	<script src="/scriptZIP/vue.min.js"></script>
	<script src="/scriptZIP/axios.min.js"></script>

	<script src="/js/common.js"></script>

	<script>
		new Vue({
			el: '#app',
			data: {
				o: {}
			},
			methods: {
				login: function () {
					if (!this.o.openid || !this.o.password) {
						alert('请填写完整');
						return;
					}

					axios.post('/api/login/app', toFormParams(this.o)).then(function (res) {
						var a = res.data.code;
						if (a == 1) {
							alert('该账号未注册');
							return;
						}
						if (a == 2) {
							alert('密码错误');
							return;
						}
						location.replace('index2.html');
					});
				}
			}
		});

	</script>

</body>

</html>